namespace SimpleWebServices.Web.UI.Html
{
    using SimpleWebServices;
    using Xunit;

    public sealed class NamesFacts
    {
        [Fact]
        public void typedef()
        {
            Assert.True(new ObjectExpectations<Names>()
                .DerivesFrom<object>()
                .IsConcreteClass()
                .IsSealed()
                .HasDefaultConstructor()
                .Result);
        }

        [Fact]
        public void ctor()
        {
            Assert.NotNull(new Names());
        }

        [Fact]
        public void ctor_string()
        {
            Assert.NotNull(new Names("test"));
        }

        [Fact]
        public void ctor_stringEmpty()
        {
            Assert.NotNull(new Names(string.Empty));
        }

        [Fact]
        public void ctor_stringNull()
        {
            Assert.NotNull(new Names(null));
        }

        [Fact]
        public void opImplicit_Names_string()
        {
            Names expected = new Names("foo bar");
            Names actual = "foo bar";

            Assert.Equal<string>(expected.ToString(), actual.ToString());
        }

        [Fact]
        public void opImplicit_Names_stringEmpty()
        {
            Names expected = new Names();
            Names actual = string.Empty;

            Assert.Equal<string>(expected.ToString(), actual.ToString());
        }

        [Fact]
        public void opImplicit_Names_stringNull()
        {
            Names expected = null;
            Names actual = null as string;

            Assert.Equal<Names>(expected, actual);
        }

        [Fact]
        public void opImplicit_string_Names()
        {
            string expected = "foo bar";
            string actual = new Names("foo bar");

            Assert.Equal<string>(expected, actual);
        }

        [Fact]
        public void opImplicit_string_NamesEmpty()
        {
            string expected = string.Empty;
            string actual = new Names();

            Assert.Equal<string>(expected, actual);
        }

        [Fact]
        public void opImplicit_string_NamesNull()
        {
            string expected = null;
            string actual = null as Names;

            Assert.Equal<string>(expected, actual);
        }

        [Fact]
        public void op_ToString()
        {
            string expected = "foo bar";

            Names obj = new Names(expected);

            string actual = obj.ToString();

            Assert.Equal<string>(expected, actual);
        }

        [Fact]
        public void op_ToStringEmpty()
        {
            string expected = string.Empty;
            string actual = new Names().ToString();

            Assert.Equal<string>(expected, actual);
        }
    }
}